ci: borrow issue-lifecycle scripts from anthropics/claude-code#51
Merged
lukeocodes merged 1 commit intomainfrom May 2, 2026
Merged
ci: borrow issue-lifecycle scripts from anthropics/claude-code#51lukeocodes merged 1 commit intomainfrom
lukeocodes merged 1 commit intomainfrom
Conversation
Four workflows were copied from anthropics/claude-code without their
backing scripts, so they have been failing on every run since they
landed:
- sweep.yml -> scripts/sweep.ts
- auto-close-duplicates.yml -> scripts/auto-close-duplicates.ts
- backfill-duplicate-comments.yml -> scripts/backfill-duplicate-comments.ts
- issue-lifecycle-comment.yml -> scripts/lifecycle-comment.ts
This PR adds the missing scripts plus their two helpers
(issue-lifecycle.ts, gh.sh) borrowed verbatim from
github.com/anthropics/claude-code/tree/main/scripts and adapted for
this repo where appropriate.
Localizations applied:
- issue-lifecycle.ts: 'Claude Code' -> 'Deepgram CLI'; support URL
repointed to developers.deepgram.com; 'claude --version' replaced
by 'dg --version' in the needs-info nudge.
- sweep.ts: NEW_ISSUE points at deepgram/cli/issues/new/choose
(everything else verbatim).
- auto-close-duplicates.ts: default owner/repo fall back to
deepgram/cli when GITHUB_REPOSITORY_OWNER/_NAME are missing
(claude-code's defaults). Removed the 'Generated with Claude Code'
attribution from the auto-close comment since this is a workflow,
not a model-generated message.
- backfill-duplicate-comments.ts: replaced the upstream's hardcoded
owner='anthropics' / repo='claude-code' with parsing from the
GITHUB_REPOSITORY env var (auto-set by GitHub Actions). This is a
real fix for re-use; upstream was implicitly assuming the script
only ever runs in claude-code.
- gh.sh: error message example updated to reference deepgram/cli.
Workflow drift check (per the CTO's request):
All four workflow YAMLs are byte-identical to upstream EXCEPT for
intentional security hardening — actions are pinned to specific
commit SHAs (e.g. actions/checkout@34e1148... # v4) instead of
version tags. No other drift. Workflows themselves do not need to
change as part of this PR.
Verification:
- 'bun build --target=bun' compiles all 5 .ts files cleanly
- 'bash -n scripts/gh.sh' passes
- gh.sh marked +x
Note: this is unrelated to the open homebrew-tap/cli rust-fix PRs,
which can merge independently of this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four workflows in this repo (`sweep.yml`, `auto-close-duplicates.yml`, `backfill-duplicate-comments.yml`, `issue-lifecycle-comment.yml`) were copied from anthropics/claude-code but without their backing scripts. The workflows have been silently failing on every run with `error: Module not found './scripts/.ts'` (or the bun equivalent).
This PR adds the missing scripts.
What lands
Workflow drift check (per the CTO's request)
All four workflow YAMLs in `.github/workflows/` are byte-identical to their upstream counterparts except for intentional security hardening — actions are pinned to specific commit SHAs (`actions/checkout@34e1148... # v4`) instead of version tags. No other drift, no other changes needed in the workflow YAMLs themselves as part of this PR.
Verification
Things to call out
Labels expected by the scripts — these scripts read/write the labels `invalid`, `needs-repro`, `needs-info`, `stale`, `autoclose`, and `duplicate`. If any are missing from this repo, the corresponding code path silently no-ops (GitHub API accepts unknown labels in queries, returns no matches). The existing `claude-issue-triage.yml` and `claude-dedupe-issues.yml` workflows in this repo presumably already use them, but worth verifying once on a real triage run.
`STATSIG_API_KEY` env var in `auto-close-duplicates.yml` — present in both the local workflow and upstream, but the script doesn't actually read it. Inherited claude-code-internal noise. I left the workflow untouched since you asked for a drift check, not a workflow refactor; happy to drop the line in a follow-up if you want.
Provenance comments — `scripts/issue-lifecycle.ts` carries a 3-line header noting it was borrowed from `anthropics/claude-code`. Other scripts inherit upstream's existing comments verbatim. Strategy: minimize divergence so future re-borrows are easy diffs.
Unrelated to the homebrew work
This PR is independent of:
Those can merge in any order, and this scripts PR is gated only on its own review.